Skip to main content

Event Store

Stream

Append an event to a stream

EventStoreDB media types

EventStoreDB supports a custom media type for posting events,

  • application/vnd.eventstore.events+json or
  • application/vnd.eventstore.events+xml.

The format represents data with the following jschema (eventId must be a UUID).

[
{
"eventId" : "string",
"eventType" : "string",
"data" : "object",
"metadata" : "object"
}
]

Model definition in feedgenerator:

This will be used when save platformEvents:

public class CreatePlatformEventRequest
{
public string EventId { get; set; }
public string EventType { get; set; }
public PlatformEvent Data { get; set; }
}

This will be used when save domainEvents:

Model definition in feedgeneratorUtil:

internal class CreateEventRequest
{
public object Data { get; set; }
public object Metadata { get; set; }
public string EventId { get; set; }
public string EventType { get; set; }
}

get stream

Invoke-restmethod -method GET -uri https://eventstore-test.pwcias.local:2114/streams/%24ce-assignee/0/forward/20?embed=rich -Headers @{Authorization="Basic YWRtaW46d2FuZ3lhbg=="}|convertto-json -depth 10
ParameterValueMeaning
embedembedNoneContent
embedembedContentRich
embedRich
embedBody
embedPrettyBodypretty to read
embedTryHarder

Projection

Projections is an EventStoreDB subsystem that lets you append new events or link existing events to streams in a reactive manner.